package models.asl;
/**
 * Edge in Graph
 * @author Tiancheng Zhang
 */
public class Edge {
	
	/**source node*/
	int sourceId;
	/**destination node*/
	int destinationId;
	/**Edge Type*/
	EdgeType type;
		

	
	/**
	 * @param sourceId
	 * @param destinationId
	 */
	public Edge(int sourceId, int destinationId, EdgeType type) {
		this.sourceId = sourceId;
		this.destinationId = destinationId;
		this.type = type;
	}


	/**
	 * @return the sourceId
	 */
	public int getSourceId() {
		return sourceId;
	}


	/**
	 * @param sourceId the sourceId to set
	 */
	public void setSourceId(int sourceId) {
		this.sourceId = sourceId;
	}


	/**
	 * @return the destinationId
	 */
	public int getDestinationId() {
		return destinationId;
	}


	/**
	 * @param destinationId the destinationId to set
	 */
	public void setDestinationId(int destinationId) {
		this.destinationId = destinationId;
	}


	/**
	 * @return the type
	 */
	public EdgeType getType() {
		return type;
	}


	/**
	 * @param type the type to set
	 */
	public void setType(EdgeType type) {
		this.type = type;
	}


	/**
	 *equals override 
	 */
	@Override
	public boolean equals(Object o)
	{
		Edge otherEdge = (Edge)o;
		
		if(this.sourceId != otherEdge.getSourceId() || this.destinationId != otherEdge.getDestinationId())
		{
			return false;
		}
		return true;
	}


	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Edge [sourceId=" + sourceId + ", destinationId="
				+ destinationId + ", type=" + type + "]";
	}

}
